<div class="full_w">
    <div class="h_title"><?php echo Yii::t('AdmincpModule.admincp', 'Add Menu'); ?></div>
    <?php 
        foreach(Yii::app()->admin->getFlashes() as $key => $message){
            echo '<div class="n_'.$key.'"><p>'.$message."</p></div>\n";
        }
    ?>
    <form action="" method="post" id="frmUser">
     	<div class="element labelTarget" style="display:none;">
            <label>Code<span class="red">*</span></label> 
            <input type="text" name="menu[menu_name]" id="menu_name" class="text required autoGeneratedTarget" value="<?php echo isset($arrItemInfo['menu_name'])?$arrItemInfo['menu_name']:null; ?>" autocomplete="off">
        </div>
    	<div class="element">
            <label>Name <span class="red">*</span></label>
            <input type="text" name="menu[menu_title]" id="menu_title" class="text required autoGeneratedSource" value="<?php echo isset($arrItemInfo['menu_title'])?$arrItemInfo['menu_title']:null; ?>" autocomplete="off">
        	<div class="text labelSource" style="display:none;">
            	Code: <span class="autoGeneratedTarget"></span> 
            	<a href="javascript:void(0);" class="autoGenerated">[edit]</a>
            </div>
        </div>
        <div class="element">
            <label>Description</label>
            <textarea class="textarea" name="menu[menu_description]" id="menu_description"><?php echo isset($arrItemInfo['menu_description'])?$arrItemInfo['menu_description']:null; ?></textarea>
        </div>   
        <div class="element">
            <label>Status</label>
            <select name="menu[menu_status]" id="menu_status">
            	<option value="0">Inactive</option>
                <option value="1" <?php if(isset($arrItemInfo['menu_status']) && $arrItemInfo['menu_status'] == '1'): ?>selected<?php endif; ?>>Active</option>
            </select>
        </div>     
        <div class="entry">
            <input type="hidden" name="id" id="id" value="<?php echo isset($arrItemInfo['menu_id'])?$arrItemInfo['menu_id']:null; ?>">
            <button type="submit">Submit</button> <button>Cancel</button>
        </div>
    </form>
</div>
<script type="text/javascript">
	var autoGen = <?php echo !empty($intId) ? 'true' : 'false'; ?>;
	$(function(){
		genAutoCode({
			button: '.autoGenerated',
			source: '.autoGeneratedSource',
			target: '.autoGeneratedTarget',
			labelSource: '.labelSource',
			labelTarget: '.labelTarget',
			lock: autoGen
		});
		$('#frmUser').validate();
	});
</script>